import {createStore} from 'vuex'

const user = "USER"
export default createStore({
    state: {
        user: JSON.parse(sessionStorage.getItem(user))
    },
    getters: {},
    mutations: {
        setUser: (state, loginUser) => {
            state.user = JSON.parse(JSON.stringify(loginUser))
            sessionStorage.setItem(user, JSON.stringify(loginUser));
        },
        delUser: () => {
            sessionStorage.removeItem(user)
        }
    },
    actions: {},
    modules: {}
})
